package com.事件处理event.Google恐龙;

import java.awt.*;

public class MyImage extends Thread{
    MyImage image = null;
    int x;
    int y;
    static boolean isLive = true;
    Image i = Toolkit.getDefaultToolkit().createImage("java-code/src/com/事件处理event/Google恐龙/1.png");

    public MyImage(int x, int y) {
        this.x = x;
        this.y = y;
    }



    @Override
    public void run() {
        while(isLive){
            if (x <= -1500)  {
                x = 1500;
            }
            x--;
            try {
                sleep(1);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

           
        }
    }
}
